﻿/*-------------------------------------------------------------------------
* 命名空间: ScreenCapture.Common/CommonExtensions
* 类       名: CommonExtensions
* 功      能:  通用扩展类,比如字符串通用扩展
* 时      间:  2023/12/5 11:28:42
* 版      本:  V1.0
* 作      者:  Fioman
* 格      言:  Talk is cheap,show me the code ^_^
*-------------------------------------------------------------------------*/
using ScreenCapture.Base.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ScreenCapture.Common
{
    public static class CommonExtensions
    {
        /// <summary>
        /// 字符串写入到粘贴板
        /// </summary>
        /// <param name="Str"></param>
        public static void WriteToClipboard(this string Str)
        {
            if (Str == null)
                return;

            var clipboard = ServiceProvider.Get<IClipboardService>();
            clipboard.SetText(Str);
        }
    }
}
